{% extends "base.html" %}
	{% block content %}
	
		{% if valid %}
			<div class="alert alert-success">Votre article a bien ete ajouté !</div>
			<p><a href="{% url 'home' %}">Revenir au catalogue</a></p>
		{% else %}
			<div class="row">
				<div class="col-sm-6 col-md-7 col-md-offset-1">
					<div class="page-header">
						<h1>Ajoutez un objet <small> Et faites partie de la communaute</small></h1>
					</div>
				</div>			
			</div>
			<div class="row">
				<div class="col-md-3 col-md-offset-1">			
					<form role="form" action="{% url 'new-article' %}" method="post" enctype="multipart/form-data">
						{% csrf_token %}
						<div class="form-group"><label for="id_owner">Propriétaire:</label> <input id="id_owner" class="form-control input-sm" maxlength="42" name="owner" placeholder="Nom" type="text" /></div>
						<div class="form-group"><label for="id_room">Chambre:</label> <input id="id_room" class="form-control input-sm" maxlength="5" name="room" placeholder="Chambre" type="text" /></div>
						<div class="form-group"><label for="id_title">Nom de l'objet:</label> <input id="id_title" class="form-control input-sm" maxlength="255" name="title" placeholder="Nom de l'objet" type="text" /></div>
						<div class="form-group"><label for="id_description">Description:</label> <textarea cols="40" id="id_description" class="form-control input-sm" name="description" placeholder="Description de l'objet prêté" rows="10"></textarea></div>
						<div class="form-group"><label for="id_mail">Adresse email:</label> <input id="id_mail" class="form-control input-sm" name="mail" placeholder="Adresse email" type="text" /></div>
						<div class="form-group"><label for="id_tel">Téléphone:</label> <input id="id_tel" class="form-control input-sm" name="tel" placeholder="Téléphone" type="text" /></div>
						<div class="form-group"><label for="id_image">Image:</label> <input id="id_image" name="image" type="file" /></div>
						<button type="submit" class="btn btn-primary">Submit</button>
					</form>
					<p><a href="{% url 'home' %}">Revenir au catalogue</a></p>
				</div>
			</div>		
		{% endif %}

	<hr>
	{% endblock %}